<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition>
        <table width="1149" border="0" cellpadding="0" cellspacing="0" >
            <tr>
                <td colspan="6"><img src="image/maintitle.png" width="1150" height="267" alt="maintitle"/></td>
            </tr>
            
            <tr>
                <h:form>
                    <td width="178"><h:commandLink action="#{page.setpage('TrangChu')}" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image2','','image/trangchu_over.png',1)" ><img src="image/trangchu.png" name="Image2" width="178" height="50" id="Image2"/></h:commandLink></td>
                    <td width="178"><h:commandLink action="#{page.setpage('TinTuc')}" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image3','','image/tintuc_over.png',1)"><img src="image/tintuc.png" name="Image3" width="178" height="50" id="Image3"/></h:commandLink></td>
                    <td width="178"><h:commandLink action="#{page.setpage('KhuyenMai')}" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image4','','image/dienthoai_over1.png',1)"><img src="image/dienthoai1.png" name="Image4" width="178" height="50" id="Image4"/></h:commandLink></td>
                    <td width="260"><h:commandLink action="#{page.setpage('HeThongSieuThi')}" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image6','','image/topdienthoaiduocuathich_over1.png',1)"><img src="image/topdienthoaiduocuathich1.png" name="Image6" width="260" height="50" id="Image6"/></h:commandLink></td>
                    <td width="178"><h:commandLink action="#{page.setpage('GioiThieu')}" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image7','','image/gioithieu_over.png',1)"><img src="image/gioithieu.png" name="Image7" width="178" height="50" id="Image7" /></h:commandLink></td>
                    <td width="178"><h:commandLink action="#{page.setpage('LienHe')}" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image5','','image/lienhe+over.png',1)"><img src="image/lienhe.png" name="Image5" width="178" height="50" id="Image5"/></h:commandLink></td>
                </h:form>
           <!--<td width="178"><h:commandLink action="sdf" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image5','','image/lienhe+over.png',1)"><h:graphicImage /></h:commandLink></td>
           -->
            </tr>


            <tr bgcolor="#D6D6D6" style="width:1150">
                <td></td>
                <c:if test="${login.gettaikhoan() ==null}">
                    <td colspan="3" bgcolor="#CCCCCC">
                        <h:form>
                            <h:outputLabel for="username" value="Username : " />
                            <h:inputText id="username" value="#{login.user}" required="true"
                                         requiredMessage="Bạn chưa điền username" >
                                <f:validator validatorId="nameValidator"/>
                            </h:inputText>

                            <h:message for="username" style="color: red;" />

                            <h:outputLabel for="password" value="Password:" />
                            <h:inputSecret id="password" value="#{login.pass}" required="true" requiredMessage="Please enter password">
                                <f:validator validatorId="passwordValidator" />
                            </h:inputSecret>

                            <h:message for="password" style="color: red;" />
                           
                            <h:commandButton  value="Login"/>
                        </h:form>

                    </td>

                    <td bgcolor="#CCCCCC" align="center">
                        <h:form>
                            <h:commandButton id="register" value="Đăng Ký" action="#{page.setpage('DangKi')}"/>    
                        </h:form>
                    </td>  
                </c:if>

                <c:if test="${login.gettaikhoan() !=null}">
                    <td colspan="2" bgcolor="#CCCCCC"><h:form>
                            <h:outputText value="Chào Bạn ${login.gettaikhoan().tendangnhap}(*v*)       "/>
                            <h:commandButton id="update" value="Sửa Thông Tin Cá Nhân" action="#{page.setpage('UpdateInfo')}"/>    
                            <h:commandButton id="logout" value="Thoat" action="#{login.setLogout()}"/> 
                               

                        </h:form>
                    </td>
                    
                        
                </c:if>
                


                <td bgcolor="#D6D6D6" style="float:right ">
                    <h:form>  
                        <h:commandLink action="#{page.setpage('GioHang')}">
                                        <h:graphicImage library="images" name="cart2.jpg" />
                                    </h:commandLink>
                    </h:form>
                    <c:if test="${login.gettaikhoan() !=null}">
                        <h:form>
                            <h:commandButton id="history" value="Lịch Sử Mua Hàng" action="#{LichSuMuaHang.LayLSMH()}"/>
                        </h:form>  </c:if>
                </td>
            </tr>
        </table>
      
    </ui:composition>

</html>
